import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';

class EditFocusUtils {
  static setFocus(FocusNode focusNode) {
    Future.delayed(const Duration(milliseconds: 300), () {
      if (!focusNode.hasFocus) {
        focusNode.requestFocus();
      }
    });
  }

  // 在任何地方调用此方法即可收起键盘
  static hideKeyboard() {
    FocusScope.of(Get.context!).unfocus();
  }
}
